import { createApp } from "vue";
import { createPinia } from "pinia";

// 引入element-plus
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";

//highlight.js
import hljsVuePlugin from "@highlightjs/vue-plugin";
import "highlight.js/styles/stackoverflow-light.css"; // 代码高亮样式
import "@wangeditor/editor/dist/css/style.css"; // wangEditor 样式
// 引入样式
import "./assets/main.scss";
//路由守卫
import "./permission";

// 引入svg
import "virtual:svg-icons-register";
import SvgIcon from "@/components/SvgIcon";
import elementIcons from "@/components/SvgIcon/svgicon";

import App from "./App.vue";
import router from "./router";
import store from "./stores";
import directive from "./directive";

const app = createApp(App);

app.use(elementIcons);
app.component("svg-icon", SvgIcon);

app.use(createPinia());
app.use(router);
app.use(store);
app.use(ElementPlus, {
  locale: zhCn,
});
app.use(hljsVuePlugin);
app.use(directive);
app.mount("#app");
